function initAddNotice(){
    $('.more').on('click',function(){
        if($('.hide').css('display') == 'none'){
            $('.hide').slideDown(600);
            $(this).children().attr('src','/public/Index/img/down2.png');
        }else{
            $('.hide').slideUp(600);
            $(this).children().attr('src','/Public/Index/img/right.png');
        }
    })
    
    //选择角色
    $('.addPriv').on('click',function(){
        layer.open({
            type: 2,
            title: [
                "选择角色",
                'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
            ],
            area: ['80%', '60%'], //宽高
            offset: ['10%', '10%'], //弹出位置 [top,left]
            content: "/index.php/Index/Index/layer/type/7"
        })
    })
}

function initDelNotice(){
    //审核公告
    $('body').on('click','.verifyNotice',function(){
        var id = $(this).attr('data-id');
        layer.open({
            type: 2,
            title: [
                "审核公告",
                'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
            ],
            area: ['80%', '60%'], //宽高
            offset: ['10%', '10%'], //弹出位置 [top,left]
            content: "/index.php/Index/Index/layer/type/8/id/"+id
        })
    })
    
    //查看审批意见
    $('body').on('click','.reason',function(){
        var id = $(this).attr('data-id');
        layer.open({
            type: 2,
            title: [
                "审批意见",
                'background-color: #437dba;color:#fff;text-align:center;font-size:1.4em',
            ],
            area: ['60%', '52%'], //宽高
            offset: ['20%', '10%'], //弹出位置 [top,left]
            content: "/index.php/Index/Index/layer/type/9/id/"+id
        })
    })
    
    $('body').on('click', '.delNotice', function () {
        var url = $('#delurl').val() + '?notice_id=' + $(this).attr('data-id');
        layer.confirm('确定删除吗', {
            closeBtn: 0,
            btn: ['确定', '取消'] //按钮
        }, function () {
            var index = layer.load(1, {shade: false});
            $.get(url, function (res) {
                console.log(res);
                layer.msg(res.info);
                location.reload();
            })
        }, function (index) {
            layer.close(index);
        });

    })
}